<%@page contentType="text/html"%>  
<%@page pageEncoding="UTF-8"%>  

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>  
<%@taglib uri="http://richfaces.org/a4j" prefix="a4j"%>  
<%@taglib uri="http://richfaces.org/rich" prefix="rich"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"   
"http://www.w3.org/TR/html4/loose.dtd">  
<html>
    <head>
        <title>Forma de Pagamento</title>
        <%@include file="../../_include/header.jsp"%>
    </head>
    <style type="text/css"><!--@import url("../../_css/style.css");--></style>
    <body>
        <f:view>
            <t:saveState id="_bean" value="#{FormaPagamentoBean}" />
            <a4j:form id="FormaPagamentoPesq" status="modalStatus">
                <rich:simpleTogglePanel switchType="client" label="Forma de Pagamento" width="95%">
                    <t:panelGrid columns="4">
                        <t:column><h:outputLabel value="Descrição" for="descricaoPesq"/></t:column>
                        <t:column>
                            <h:inputText value="#{FormaPagamentoBean.descricaoPesq}" id="descricaoPesq" maxlength="40" style="width:200px;"/>
                        </t:column>
                        <t:column>&nbsp;</t:column>
                        <t:column>&nbsp;</t:column>

                        <t:column><h:commandButton value="Pesquisar" action="#{FormaPagamentoBean.pesquisar}"/>&nbsp;&nbsp;</t:column>
                        <t:column><h:commandButton value="Novo" action="#{FormaPagamentoBean.incluir}"/>&nbsp;&nbsp;</t:column>
                        <t:column>&nbsp;</t:column>
                        <t:column>&nbsp;</t:column>
                    </t:panelGrid>                </rich:simpleTogglePanel>
                <rich:dataTable id="tblFormaPagamentos" value="#{FormaPagamentoBean.listaFormaPagamentos}" var="list"
                                width="95%" columnClasses="center" rows="50" reRender="ds">
                    <rich:column width="40px">
                        <f:facet name="header">
                            <h:outputText value="Cód"/>
                        </f:facet>
                        <h:outputText value="#{list.id}"/>
                    </rich:column>
                    <rich:column filterBy="#{list.descricao}" filterEvent="onkeyup" breakBefore="false" sortBy="#{list.descricao}">
                        <f:facet name="header">
                            <h:outputText value="Descrição"/>
                        </f:facet>
                        <h:outputText value="#{list.descricao}"/>
                    </rich:column> 
                    <rich:column style="text-align:center;">
                        <f:facet name="header">
                            <h:outputText value="Num Parc Permitidas"/>
                        </f:facet>
                        <h:outputText value="#{list.parcelasPermitidas}"/>
                    </rich:column>
                    <rich:column style="text-align:center;">
                        <f:facet name="header">
                            <h:outputText value="Baixa Automática"/>
                        </f:facet>
                        <h:graphicImage url="../../_images/passed.gif" rendered="#{list.baixaAutomatica}"/>
                        <h:graphicImage url="../../_images/error.gif" rendered="#{!list.baixaAutomatica}"/>
                    </rich:column>

                    <rich:column width="50px">
                        <f:facet name="header">
                            <h:outputText value="Ações"/>
                        </f:facet>
                        <h:commandButton image="../../_images/btn_alterar.gif" title="Alterar Registro" binding="#{FormaPagamentoBean.btnAlterar}" value="#{list.id}" action="#{FormaPagamentoBean.alterar}"/>&nbsp;
                        <h:commandButton image="../../_images/btn_excluir.gif" title="Exluir Registro" binding="#{FormaPagamentoBean.btnExcluir}" value="#{list.id}" action="#{FormaPagamentoBean.excluir}"/>
                    </rich:column>

                    <f:facet name="footer">
                        <rich:datascroller id="ds"></rich:datascroller>
                    </f:facet>
                    
                </rich:dataTable>
                <a4j:status id="modalStatus" onstart="Richfaces.showModalPanel('ajaxLoadingModalBox')"
                onstop="Richfaces.hideModalPanel('ajaxLoadingModalBox')" />
            </a4j:form>
        </f:view>
    </body>
</html>